package com.licenta.fbApp.shared;

import java.io.Serializable;
import java.util.ArrayList;

public class Restaurant implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8042799653981405853L;
	
	/**
	 * @uml.property  name="name"
	 */
	public String name;					//numele restaurantului
	/**
	 * @uml.property  name="address"
	 */
	public String address;				//adresa
	/**
	 * @uml.property  name="url"
	 */
	public String url;					//url catre pagina oficiala
	/**
	 * @uml.property  name="link"
	 */
	public String link;					//link catre mai multe detalii de pe acelasi site	
	/**
	 * @uml.property  name="details"
	 */
	public String details;				//detalii restaurant
	/**
	 * @uml.property  name="rating"
	 */
	public double rating;					//rating
	/**
	 * @uml.property  name="votes"
	 */
	public int votes;					//nr total voturi primite
	/**
	 * @uml.property  name="pics"
	 * @uml.associationEnd  multiplicity="(0 -1)" elementType="java.lang.String"
	 */
	public ArrayList<String> pics;		// lista de cai catre fisierele de imagini restaurant
	

	public Restaurant() 
	{
		name = ""; address = ""; url = ""; details = "";
		rating = 0; votes = 0; pics = new ArrayList<String> (10);		
	}
	
	public Restaurant(String name, String addr, double rating, int votes, String link) 
	{
		this.name = name;
		this.address = addr;
		this.rating = rating;
		this.votes = votes;
		this.link = link;
		url = ""; details = "";
		pics = new ArrayList<String> (10);	
	}
	
	public void setURL(String URL)
	{
		this.url = URL;
	}
	
	public void setDetails (String detail){
		this.details.concat(detail);
	}
	
	public void addImage(String path) 
	{
		if ( pics.size() < 10) {
			pics.add(path);
		}
	}	
	
	public String toString() {
		return this.name + ", " + this.address + ", rating " + this.rating + " " + this.link;		
	}
	
}
